<?php
namespace App\Http\Query;

use Illuminate\Support\Facades\DB;

/*
 * 新商品情報
 *
 */
class NewGoodsQuery
{

    // とりnew_flg=1
    public function getGoodsNew()
    {
        $sql = 'select goods_id,category_id from goods_master where new_flg=1 and delete_flg = 0';
        $goodsnew = DB::select($sql);
        return $goodsnew;
    }

    // 新商品の図
    public function getNewPic($goodsId)
    {
        $sql = 'select image_url from goods_picture where goods_id= ? and delete_flg = 0';
        $param = [
            $goodsId
        ];
        $goodsPic = DB::select($sql, $param);
        return $goodsPic;
    }
}
